﻿using MyX.Bus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyX.Provider
{

    internal abstract class BusProvider : IProvider
    {

        public object Get()
        {
            return _bus;
        }

        public T Get<T>()
        {
            return (T)Get();
        }

        protected XIMessageBus _bus;
    }

    internal class CommandBusProvider : BusProvider
    {
        public CommandBusProvider(XIMQ mq)
        {
            _bus = new XCommandBus(mq);
        }
    }

    internal class EventBusProvider : BusProvider
    {
        public EventBusProvider(XIMQ mq)
        {
            _bus = new XEventBus(mq);
        }
    }

    internal class StatusBusProvider : BusProvider
    {
        public StatusBusProvider(XIMQ mq)
        {
            _bus = new XWorkStatusBus(mq);
        }
    }

    internal class ResultBusProvider : BusProvider
    {
        public ResultBusProvider(XIMQ mq)
        {
            _bus = new XWorkResultBus(mq);
        }
    }

}
